<div class="table-responsive">

  <div class="filter-bar">
	<form action="__CONTROLLER__/index" method="post" >
		<div class="view">
			<div class="row clearfix">
				<div class="col-md-3 column ui-sortable">
				    <label class="col-sm-3 control-label">日期：</label>
				    <div class="col-sm-9">
				     <input type="text" class="form-control" id="date" name="date" placeholder="请选择查询日期" value="{$params.date}">
				    </div>
				</div>
				<div class="col-md-3 column ui-sortable">
				    <div class="col-sm-9">
				       <input type="submit" class="btn btn-info submit" value="搜索"/>
				        <input id="btnExportExcel" data-url="{:U('SeckillApply/exportXLS', $params)}" type="button" class="btn btn-info" value="导出Excel"/>
				    </div>
				</div>
			</div>
		</div>
	</form>
  </div>
  <hr/>
<table class="table table-hover">
  <thead>
    <tr>
      <th>ID</th>
      <th>姓名</th>
      <th>电话</th>
      <th>宿舍号</th>
      <th>活动日期</th>
      <th>申请时间</th>
      <th>抢购情况</th>
      <th>操作</th>
    </tr>
  </thead>
  <tbody>
  <volist name="seckillApply" id="vo">
  <tr>
    <td>{$vo.id}</td>
    <td>{$vo.name}</td>
     <td>{$vo.tel}</td>
     <td>{$vo.room_id}</td>
     <td>{$vo.date}</td>
    <td>{$vo.apply_time|date="Y-m-d H:i:s", ###}</td>
     <td>{$vo["is_error"]?"抢购未成功":"抢购成功"}</td>
    
    <td>
     <td>
      <select class="audit" data-id="{$vo.id}">{$vo.statusOptions}</select>
       <a class="btn btn-danger btn-xs actionds" data-action-id="{$vo.id}" data-action-txt="移除中……" data-action-url="__CONTROLLER__/remove">移除</a>
      </td>
    </td>
  </tr>
  </volist>
  </tbody>
</table>
<div class="pagination">{$pagination}</div>

<!-- datetimepicker -->
<link rel="stylesheet" href="__PUBLIC__/Style/Common/datetimepicker/jquery-ui-1.10.0.custom.min.css">
<script type="text/javascript" src="__PUBLIC__/Style/Common/datetimepicker/jquery-ui-1.10.0.custom.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/Style/Common/datetimepicker/jquery-ui-timepicker-addon.js"></script>
<script type="text/javascript" src="__PUBLIC__/Style/Common/datetimepicker/jquery-ui-timepicker-zh-CN.js"></script>
<script type="text/javascript">
  //时间
  $(function(){
	  $("#date").datepicker({dateFormat:'yy-mm-dd'});
  });
 
</script>
<script type="text/javascript">
  $(function(){
	  $("#btnExportExcel").click(function() {
		  	window.location.href = $(this).attr('data-url');
		  });
	  
	  
    $( ".table" ).delegate( ".audit", "change", function(){
      var status = $( this ).val(),
          id = $( this ).attr( "data-id" );
      $.post ( "__CONTROLLER__/setStatus", { "id": id, "status": status}, function(data){
        if( data.error ) {
          $().alertMsg( { "type": "error", "msg": data.msg } );
        } else {
          $().alertMsg( { "type": "success", "msg": data.msg } );
        };
      });
    });
  });
</script>
